<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .enter-form {
      transform: translateX(200px);
    }
    .enter-to {
      transform: translateX(0);
    }
    .enter-active {
      transition: transform 1s ease-in-out;
    }
    .leave-form {
      transform: translateX(0);
    }
    .leave-to {
      transform: translateX(200px);
    }
    .leave-active {
      transition: transform 1s ease-out;
    }
  </style>
</head>
<body>
  <div id="app"></div>
  <!-- <div id="btn">++</div>
  <p id="box">123</p> -->
  
  <!-- <script src="https://unpkg.com/@vue/reactivity@3.0.5/dist/reactivity.global.js"></script> -->
  <!-- <script src="./compiler/index.js"></script> -->

  <script type="module">
    import { renderer, normalizeClass } from './compiler/index.js'
    import { effect, ref, reactive } from './reactivity/reactivity.js'
    import { onMounted, Transition } from './runtime-core/index.js'
    import { defineAsyncComponent } from './runtime-dom/index.js'

    // const { effect, ref } = VueReactivity

    const comp = {
      render() {
        return {
          type: Transition,
          children: {
            default() {
              return {
                type: 'div',
                children: '我是需要过渡的元素'
              }
            }
          }
        }
      }
    }

    const oldVnode = {
      type: comp,
      // props: {
      //   title: 'title'
      // }
    }

    const container = document.querySelector('#app')

    effect(() => {
      renderer.render(oldVnode, container)
      // foo.bar = '000'

      // setTimeout(() => {
      //   renderer.render(newVnode, container)
      // }, 1000)

    })

  </script>
</body>
</html>
